fix(fish): pass multi-segment CLI paths as separate arguments#143
Merged
Conversation
Completing a package-manager-delegated CLI in fish with more than one path segment (e.g. `pnpm <cli> <subcommand> --<TAB>`) returned nothing and fell back to the package manager's own flags. The generated fish script built the request with `string join ' '` + `eval`, and since fish does not expand bare `(...)` command substitution inside double quotes, the whole path collapsed into a single token on re-parse. Invoke the backend directly with fish list expansion so every segment reaches the completion backend as its own argument. zsh/bash already quote each argument individually; PowerShell was audited and is unaffected. Adds a fish delegation integration test (mycli fixture) plus multi-segment cases in the cross-shell argv test to guard against regressions. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: fb902a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm <cli> <subcommand> --<TAB>returned nothing and fell back to the PM's own flags).string join ' '+eval, and fish does not expand bare(...)command substitution inside double quotes, so the whole path collapsed into a single token on re-parse. zsh/bash quote each arg individually; PowerShell was audited and is unaffected.string join/eval).Notes
bin/); this PR is purelysrc/fish.ts+ tests.pnpm, PM-self flags) are unaffected — verified end-to-end.Test plan
tests/fish-integration.test.ts— new e2e delegation test via a self-containedmyclifixture (pnpm mycli <sub> <TAB>), fails on old template, passes now.tests/shell-empty-argv.test.ts— added multi-segment cases across shells.tests/completion-exec.test.ts,tests/shell.test.ts— updated for the new fish template.main.Made with Cursor